import _axios from '../plugins/axios';
import store from '../store';
import {getParamsStr} from "../utils";

class Order {
	createOrder(params) {
		let query = getParamsStr(params);
		return _axios.post('small4/order/create', query, {
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded'
			}
		})
	}

	getOrderDetail(id) {
		let token = store.state.user.token;
		return _axios.post('small4/order/detail?token=' + token + '&id=' + id, {token})
	}
}

export default Order;
